Imports System.Collections.Generic
Imports System.Drawing
Imports System.Windows.Forms
Imports DataAccessLayer.DLMain
Imports UniversalLayer

''' <summary>
''' NO COMMENTS
''' </summary>
''' <remarks></remarks>
Public Class DLEntertainment

    'Dim _DLMain As New DLMain
    'Dim _DLReader As New DLReader

    Private iPKey As Integer
    Private sTitle As String
    Private sAltTitle As String
    Private sDirector As String             'RKD: split and enter in REL table
    Private imgPoster As Byte()
    Private sPosterName As String
    Private sFileLocation As String
    Private iReleaseYear As Integer
    Private iRatingIMDb As Double
    Private iRatingCustom As Integer
    Private sGenre As String                'RKD: split and enter in REL table
    Private sCountry As String               'RKD: split and enter in REL table
    Private sStudio As String
    Private sClassification As String
    Private pkColour As Integer
    Private sColour As String
    Private pkDvdRegion As Integer
    Private sDvdRegion As String
    Private pkDvdLayer As Integer
    Private sDvdLayer As String
    Private pkMedium As Integer
    Private sMedium As String
    Private pkVCodec As Integer
    Private sVCodec As String
    Private pkACodec As Integer
    Private sACodec As String
    Private pkCondition As Integer
    Private sCondition As String
    Private pkVolume As Integer
    Private sVolume As String
    Private pkSeriesParent As Integer
    Private pkCollection As Integer
    Private sCollection As String
    Private iRuntimeMins As Integer
    Private sCasting As String
    Private sPlot As String
    Private sNotes As String
    Private iSerialNo As Integer
    Private iNDiscs As Integer
    Private iNSeason As Integer
    Private iNEpisode As Integer
    Private sIMDbCode As String
    Private sLinkIMDb As String
    Private sLinkTrailer As String
    Private sLinkOfficial As String
    Private sLinkWiki As String
    Private sReviews As String
    Private bSeen As Object
    Private bLoaned As Boolean

    'Public Sub DLMuvee(ByVal sConnectionString As String)
    '
    'End Sub

    ''' <summary>
    ''' NO COMMENTSPKey
    ''' </summary>
    ''' <value>EntertainmentMain.PKey</value>
    ''' <remarks>EntertainmentMain.PKey</remarks>
    Public ReadOnly Property cPKey() As Integer
        Get
            Return iPKey
        End Get
    End Property

    ''' <summary>
    ''' NO COMMENTSTitle
    ''' </summary>
    ''' <value></value>
    ''' <returns>EntertainmentMain.Title</returns>
    ''' <remarks>EntertainmentMain.Title</remarks>
    Public Property cTitle() As String
        Get
            Return sTitle
        End Get
        Set(ByVal value As String)
            sTitle = value
        End Set
    End Property

    ''' <summary>
    ''' NO COMMENTSAlternateTitle
    ''' </summary>
    ''' <value></value>
    ''' <returns>EntertainmentMain.AlternateTitle</returns>
    ''' <remarks>EntertainmentMain.AlternateTitle</remarks>
    Public Property cAlternateTitle() As String
        Get
            Return sAltTitle
        End Get
        Set(ByVal value As String)
            sAltTitle = value
        End Set
    End Property

    ''' <summary>
    ''' NOT FINALIZED
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cDirector() As String
        Get
            Return sDirector
        End Get
        Set(ByVal value As String)
            sDirector = value
        End Set
    End Property

    ''' <summary>
    ''' NOT FINALIZED
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cPoster() As Byte()
        Get
            Return imgPoster
        End Get
        Set(ByVal value As Byte())
            imgPoster = value
        End Set
    End Property

    ''' <summary>
    ''' NO COMMENTS: PosterLocation
    ''' </summary>
    ''' <value></value>
    ''' <returns>EntertainmentMain.PosterLocation</returns>
    ''' <remarks>EntertainmentMain.PosterLocation</remarks>
    Public Property cPosterLocation() As String
        Get
            Return sPosterName
        End Get
        Set(ByVal value As String)
            sPosterName = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets File Location
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cFileLocation() As String
        Get
            Return sFileLocation
        End Get
        Set(ByVal value As String)
            sFileLocation = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets Release Year
    ''' </summary>
    ''' <value></value>
    ''' <returns>EntertainmentMain.ReleaseYear</returns>
    ''' <remarks>EntertainmentMain.ReleaseYear</remarks>
    Public Property cReleaseYear() As Integer
        Get
            Return iReleaseYear
        End Get
        Set(ByVal value As Integer)
            iReleaseYear = value
        End Set
    End Property

    ''' <summary>
    ''' NO COMMENTS
    ''' </summary>
    ''' <value></value>
    ''' <returns>EntertainmentMain.</returns>
    ''' <remarks>EntertainmentMain.</remarks>
    Public Property cRatingIMDb() As Double
        Get
            Return iRatingIMDb
        End Get
        Set(ByVal value As Double)
            iRatingIMDb = value
        End Set
    End Property

    ''' <summary>
    ''' NO COMMENTS
    ''' </summary>
    ''' <value></value>
    ''' <returns>EntertainmentMain.</returns>
    ''' <remarks>EntertainmentMain.</remarks>
    Public Property cRatingCustom() As Integer
        Get
            Return iRatingCustom
        End Get
        Set(ByVal value As Integer)
            iRatingCustom = value
        End Set
    End Property

    ''' <summary>
    ''' NO COMMENTS
    ''' </summary>
    ''' <value></value>
    ''' <returns>EntertainmentMain.</returns>
    ''' <remarks>EntertainmentMain.</remarks>
    Public Property cGenre() As String
        Get
            Return sGenre
        End Get
        Set(ByVal value As String)
            sGenre = value
        End Set
    End Property

    ''' <summary>
    ''' NOT FINALIZED
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cCountry() As String
        Get
            Return sCountry
        End Get
        Set(ByVal value As String)
            sCountry = value
        End Set
    End Property

    ''' <summary>
    ''' NOT FINALIZED
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cStudio() As String
        Get
            Return sStudio
        End Get
        Set(ByVal value As String)
            sStudio = value
        End Set
    End Property

    ''' <summary>
    ''' NOT FINALIZED
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cClassification() As String
        Get
            Return sClassification
        End Get
        Set(ByVal value As String)
            sClassification = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cColourPKey() As Integer
        Get
            Return pkColour
        End Get
        Set(ByVal value As Integer)
            pkColour = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cColour() As String
        Get
            Return sColour
        End Get
        Set(ByVal value As String)
            sColour = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cDVDRegionPKey() As Integer
        Get
            Return pkDvdRegion
        End Get
        Set(ByVal value As Integer)
            pkDvdRegion = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cDVDRegion() As String
        Get
            Return sDvdRegion
        End Get
        Set(ByVal value As String)
            sDvdRegion = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cDVDLayerPKey() As Integer
        Get
            Return pkDvdLayer
        End Get
        Set(ByVal value As Integer)
            pkDvdLayer = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cDVDLayer() As String
        Get
            Return sDvdLayer
        End Get
        Set(ByVal value As String)
            sDvdLayer = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cMediumPKey() As Integer
        Get
            Return pkMedium
        End Get
        Set(ByVal value As Integer)
            pkMedium = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cMedium() As String
        Get
            Return sMedium
        End Get
        Set(ByVal value As String)
            sMedium = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cVCodecPKey() As Integer
        Get
            Return pkVCodec
        End Get
        Set(ByVal value As Integer)
            pkVCodec = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cVCodec() As String
        Get
            Return sVCodec
        End Get
        Set(ByVal value As String)
            sVCodec = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cVolumePKey() As Integer
        Get
            Return pkVolume
        End Get
        Set(ByVal value As Integer)
            pkVolume = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cACodecPKey() As Integer
        Get
            Return pkACodec
        End Get
        Set(ByVal value As Integer)
            pkACodec = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cACodec() As String
        Get
            Return sACodec
        End Get
        Set(ByVal value As String)
            sACodec = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cConditionPKey() As Integer
        Get
            Return pkCondition
        End Get
        Set(ByVal value As Integer)
            pkCondition = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cCondition() As String
        Get
            Return sCondition
        End Get
        Set(ByVal value As String)
            sCondition = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cVolume() As String
        Get
            Return sVolume
        End Get
        Set(ByVal value As String)
            sVolume = value
        End Set
    End Property

    ''' <summary>
    ''' NO COMMENTS
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cSeriesParentPKey() As Integer
        Get
            Return pkSeriesParent
        End Get
        Set(ByVal value As Integer)
            pkSeriesParent = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cCollectionPKey() As Integer
        Get
            Return pkCollection
        End Get
        Set(ByVal value As Integer)
            pkCollection = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cCollection() As String
        Get
            Return sCollection
        End Get
        Set(ByVal value As String)
            sCollection = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cRunTimeMins() As Integer
        Get
            Return iRuntimeMins
        End Get
        Set(ByVal value As Integer)
            iRuntimeMins = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cCasting() As String
        Get
            Return sCasting
        End Get
        Set(ByVal value As String)
            sCasting = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cPlot() As String
        Get
            Return sPlot
        End Get
        Set(ByVal value As String)
            sPlot = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cNotes() As String
        Get
            Return sNotes
        End Get
        Set(ByVal value As String)
            sNotes = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cSerialNo() As Integer
        Get
            Return iSerialNo
        End Get
        Set(ByVal value As Integer)
            iSerialNo = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cNDiscs() As Integer
        Get
            Return iNDiscs
        End Get
        Set(ByVal value As Integer)
            iNDiscs = value
        End Set
    End Property

    ''' <summary>
    ''' NO COMMENTS
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cNSeason() As Integer
        Get
            Return iNSeason
        End Get
        Set(ByVal value As Integer)
            iNSeason = value
        End Set
    End Property

    ''' <summary>
    ''' NO COMMENTS
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cNEpisode() As Integer
        Get
            Return iNEpisode
        End Get
        Set(ByVal value As Integer)
            iNEpisode = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cIMDbCode() As String
        Get
            Return sIMDbCode
        End Get
        Set(ByVal value As String)
            sIMDbCode = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cLinkIMDb() As String
        Get
            Return sLinkIMDb
        End Get
        Set(ByVal value As String)
            sLinkIMDb = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cLinkTrailer() As String
        Get
            Return sLinkTrailer
        End Get
        Set(ByVal value As String)
            sLinkTrailer = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cLinkOfficial() As String
        Get
            Return sLinkOfficial
        End Get
        Set(ByVal value As String)
            sLinkOfficial = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cLinkWikipedia() As String
        Get
            Return sLinkWiki
        End Get
        Set(ByVal value As String)
            sLinkWiki = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cReviews() As String
        Get
            Return sReviews
        End Get
        Set(ByVal value As String)
            sReviews = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cSeen() As Object
        Get
            Return bSeen
        End Get
        Set(ByVal value As Object)
            bSeen = value
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets `
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property cLoaned() As Boolean
        Get
            Return bLoaned
        End Get
        Set(ByVal value As Boolean)
            bLoaned = value
        End Set
    End Property

    '''' <summary>
    '''' NO COMMENTS
    '''' </summary>
    '''' <remarks></remarks>
    'Public Sub New()
    '' ''
    'End Sub

    ''' <summary>
    ''' Creates a new instance of DLEntertainment class
    ''' </summary>
    ''' <param name="sEntertainmentMainPKey">EntertainmentMain.PKey</param>
    ''' <param name="iPosterParent">Poster parent control</param>
    ''' <remarks></remarks>
    Public Sub New(ByVal sEntertainmentMainPKey As Integer, ByVal iPosterParent As ePosterParent)
        Try
            iPKey = sEntertainmentMainPKey
            FetchOneRecord(sEntertainmentMainPKey, iPosterParent)
        Finally
            sEntertainmentMainPKey = Nothing
        End Try
    End Sub

    ''' <summary>
    ''' NO COMMENTS
    ''' </summary>
    ''' <param name="sEntertainmentMainPKey">EntertainmentMain.PKey</param>
    ''' <param name="iPosterParent">Poster parent control</param>
    ''' <remarks></remarks>
    Private Sub FetchOneRecord(ByVal sEntertainmentMainPKey As Integer, ByVal iPosterParent As ePosterParent)
        Dim dtMuvee As New DataTable
        Dim _DLReader As New DLReader("DLEntertainment")

        Try
            _DLReader.ExecuteSQL("SELECT TOP 1 * FROM MuveeDetailsView WHERE PKey='" & sEntertainmentMainPKey & "'", dtMuvee)
            FetchOneRecord(dtMuvee.Rows(0), iPosterParent)
        Finally
            sEntertainmentMainPKey = Nothing
            dtMuvee = Nothing
            _DLReader = Nothing
        End Try
    End Sub

    ''' <summary>
    ''' NO COMMENTS
    ''' </summary>
    ''' <param name="drMuvee"></param>
    ''' <param name="iPosterParent">Poster parent control</param>
    ''' <remarks></remarks>
    Private Sub FetchOneRecord(ByVal drMuvee As DataRow, ByVal iPosterParent As ePosterParent)
        ' = drMuvee.Item("PKey")
        ' = drMuvee.Item("StagePKey")
        cSerialNo = CInt(drMuvee.Item("SerialNo"))
        'cSeen = CBool(drMuvee.Item("tmpSeen"))
        cLoaned = CBool(ULConverter.ConvertStringToBool(drMuvee.Item("tmpLoaned").ToString))
        cTitle = drMuvee.Item("Title").ToString
        cAlternateTitle = drMuvee.Item("AlternateTitle").ToString
        cIMDbCode = drMuvee.Item("ID").ToString
        'cSeen = CBool(oDLMain.ConvertStringToBool(drMuvee.Item("Seen").ToString))
        cSeen = CInt(drMuvee.Item("Seen"))
        cRatingIMDb = CInt(drMuvee.Item("Rating"))
        cRatingCustom = CInt(drMuvee.Item("MyRating"))
        cDirector = drMuvee.Item("Director").ToString
        cVolumePKey = CInt(drMuvee.Item("VolumeMainPKey"))
        cVolume = drMuvee.Item("Volume").ToString
        cCollectionPKey = CInt(drMuvee.Item("CollectionMainPKey"))
        cCollection = drMuvee.Item("Collection").ToString
        cGenre = drMuvee.Item("Genre").ToString
        cReleaseYear = CInt(drMuvee.Item("Year"))
        cStudio = drMuvee.Item("Studio").ToString
        cCasting = drMuvee.Item("Casting").ToString
        cPlot = drMuvee.Item("Plot").ToString
        cNotes = drMuvee.Item("Notes").ToString
        cCountry = drMuvee.Item("Country").ToString
        'POSTER = ""
        cPosterLocation = CreatePosterPath(Nothing, drMuvee.Item("PosterLocation").ToString, , iPosterParent) 'sPosterDirectory.TrimEnd("\"c) & "\" & drMuvee.Item("PosterLocation").ToString & "." & sPosterExtension
        cClassification = drMuvee.Item("Classification").ToString
        cNDiscs = CInt(drMuvee.Item("nDiscs"))
        cRunTimeMins = CInt(drMuvee.Item("RunTime"))
        cDVDLayerPKey = CInt(drMuvee.Item("LayerMainPKey"))
        cDVDLayer = drMuvee.Item("Layer").ToString
        cColourPKey = CInt(drMuvee.Item("ColourMainPKey"))
        cColour = drMuvee.Item("Colour").ToString
        cDVDRegionPKey = CInt(drMuvee.Item("RegionMainPKey"))
        cDVDRegion = drMuvee.Item("Region").ToString
        cMediumPKey = CInt(drMuvee.Item("MediumMainPKey"))
        cMedium = drMuvee.Item("Medium").ToString
        cVCodecPKey = CInt(drMuvee.Item("VCodecMainPKey"))
        cVCodec = drMuvee.Item("VCodec").ToString
        cACodecPKey = CInt(drMuvee.Item("ACodecMainPKey"))
        cACodec = drMuvee.Item("ACodec").ToString
        cConditionPKey = CInt(drMuvee.Item("CondMainPKey"))
        cCondition = drMuvee.Item("Condition").ToString
        cLinkIMDb = drMuvee.Item("IMDbLink").ToString
        cLinkTrailer = drMuvee.Item("IMDbTrailerLink").ToString
        cLinkOfficial = drMuvee.Item("OfficialSite").ToString
        cLinkWikipedia = drMuvee.Item("WikipediaLink").ToString
        cReviews = drMuvee.Item("MyReviews").ToString
        ' = drMuvee.Item("Status")

        'drMuvee = Nothing
    End Sub

End Class